<!--
 * @Author: 孙大大
 * @Date: 2022-04-09 03:35:21
 * @LastEditTime: 2022-04-13 20:03:43
 * @FilePath: \黑马面面111\src\views\questions\list.vue
-->
<template>
  <div class="list-container">
    <el-card class="box-card">
      <div slot="header" class="clearfix">
        <el-button
          @click="$router.push('/tiku/shiti')"
          type="primary"
          style="
            float: right;
            padding: 10px 20px;
            font-size: 14px;
            border-radius: 4px;
          "
          >新增试题</el-button
        >
      </div>
      <!-- form表单 -->
      <!-- <aaa @getQuestionList="getQuestionList"></aaa> -->
      <aaa @updataQuestionList="updataQuestionList"></aaa>
      <!-- 搜索结果显示区域 -->
    </el-card>
    <!-- <bbb :resultList="resultList"></bbb> -->
    <bbb :resultList="resultList" ref="result"></bbb>
  </div>
</template>

<script>
// 搜索表单组件
import aaa from "./list/form.vue";
// 搜索结果组件
import bbb from "./list/search.vue";

export default {
  name: "List",
  components: {
    aaa,
    bbb,
  },
  data() {
    return {
      resultList: [],
    };
  },
  methods: {
    updataQuestionList(data) {
      // 获取搜索结果
      this.resultList = data;
      // console.log(this.resultList);
      this.$refs.result.tableData = this.resultList;
    },
  },
};
</script>

<style lang="scss" scoped>
::v-deep.list-container {
  padding: 20px;

  .el-card__header {
    border: 0;
  }

  .el-card__body {
    padding: 0;
  }
}
</style>
